package com.tmt.im.jpa.repository;

import com.tmt.data.jpa.repository.ITmtBaseRepo;
import com.tmt.im.jpa.entity.IMUser;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/7/13 19:03
 * @Version 1.0
 **/
@Repository
public interface IMUserRepo extends ITmtBaseRepo<IMUser, Long> {

    IMUser findByUsername(String name);

    IMUser findFirstByOrderByIdDesc();

    @Query("select max(t.updateTime) from IMUser t where t.updateTime is not null")
    Timestamp queryMaxUpdateTime();

}
